package com.pulse.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pulse.common.annotation.Excel;
import com.pulse.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 报警记录对象 otu_alarm
 *
 * @author 陆帅
 * @date 2024-08-26
 */
public class Alarm extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    private Long alarmId;

    /** 设备编号 */
    @Excel(name = "设备编号",sort = 1)
    private String deviceNo;

    /** 通道号 */
    @Excel(name = "通道号",sort = 2)
    private Integer channel;

    /** 告警曲线id  线路告警时存值 */
    private Long measureId;

    /** 参考曲线id */
    private Long referId;

    /** 消息类型（ 1：设备告警  2：线路告警  3：系统告警 4：消息通知） */
    @Excel(name = "消息类型", readConverterExp = "1=设备告警,2=线路告警,3=系统告警,4=消息通知",sort = 4)
    private Integer alarmType;

    /** 消息等级（ 1=一级,2=二级,3=三级） */
    @Excel(name = "消息等级", readConverterExp = "1=一级,2=二级,3=三级",sort = 5)
    private Integer level;

    /** 报警类型 full_length 全程长度报警  full_atten 全程衰耗报警    device_network_interruption 设备连接断开 */
    private String type;

    /** 报警明细 */
    @Excel(name = "报警明细",sort = 6)
    private String description;

    /** 创建时间 */
    @Excel(name= "报警时间",sort = 8)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 设备 */
    private Device device;

    public Long getAlarmId() {
        return alarmId;
    }

    public void setAlarmId(Long alarmId) {
        this.alarmId = alarmId;
    }

    public String getDeviceNo() {
        return deviceNo;
    }

    public void setDeviceNo(String deviceNo) {
        this.deviceNo = deviceNo;
    }

    public Integer getChannel() {
        return channel;
    }

    public void setChannel(Integer channel) {
        this.channel = channel;
    }

    public Long getMeasureId() {
        return measureId;
    }

    public void setMeasureId(Long measureId) {
        this.measureId = measureId;
    }

    public Long getReferId() {
        return referId;
    }

    public void setReferId(Long referId) {
        this.referId = referId;
    }

    public Integer getAlarmType() {
        return alarmType;
    }

    public void setAlarmType(Integer alarmType) {
        this.alarmType = alarmType;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Device getDevice() {
        return device;
    }

    public void setDevice(Device device) {
        this.device = device;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("alarmId", getAlarmId())
                .append("deviceNo", getDeviceNo())
                .append("channel", getChannel())
                .append("measureId", getMeasureId())
                .append("referId", getReferId())
                .append("alarmType", getAlarmType())
                .append("level", getLevel())
                .append("description", getDescription())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
